package DAOtest;

import java.util.List;
import java.util.Map;

import org.junit.Test;

import Crawler_data.Crawler_data;
import DAO.SongDOA;
import DAO.Singers_DAO;
import Download.LoadUser;
import each_class.SongClass;

public class songDAOTest {
	
	@Test
	public void songAdd() {
		SongDOA songDOA = new SongDOA();
		
		int t = 0; 
		List<SongClass> ls = Crawler_data.grabble("海底", t);
		try {
			for(SongClass sc : ls) {
				
				
				//  System.out.println(sc.toString());
				songDOA.addSong(sc);
			}
		// System.out.println(ls.get(0).toString());
		 
		 LoadUser lu = new LoadUser();
		System.out.println(lu.loadSong(songDOA.find(ls.get(0).getSong_id()))); ;
			
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
	}
	
}
